#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int findMaxConsecutiveOnes(int* nums, int numsSize)
{
    int i = 0;
    int j = 0;
    int count = 0;
    int num[3000] = { 0 };
    for (i = 0; i < numsSize; i++)
    {
        if (nums[i])
        {
            count++;
        }
        if (count > 0 && (nums[i] == 0 || i == numsSize - 1))
        {
            num[j] = count;
            j++;
            count = 0;
        }
    }
    int max = 0;
    for (i = 0; i <= j; i++)
    {
        max = max > num[i] ? max : num[i];
    }
    return max;
}
int main()
{
    int nums[6] = { 1,1,0,1,1,1 };
    printf("%d", findMaxConsecutiveOnes(nums, 6));
    return 0;
}